package com.hq.fxh.No4_XiaoXi.Tongzhi;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.hq.fxh.R;

/**
 * /**
 *
 * @author 薛
 * @ClassName
 * @Description :
 * @Created 2017/9/18
 * @Email xlwenhao1858@sina.com
 */


public class Ladapter_TongZhi extends BaseAdapter {
    @Override
    public int getCount() {
        return 10;
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View convertView, ViewGroup parent) {
        View view = convertView;
        ViewHolder viewHolder = null;
        if (view == null || !(view.getTag() instanceof ViewHolder)) {
            view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_tongzhi, null);
            viewHolder = new ViewHolder(view);
            view.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) view.getTag();
        }


        return view;
    }

    static class ViewHolder {
        protected ImageView imageTongZhiPic;
        protected TextView tvTongZhiTitle;
        protected TextView tvTongZhiContent;
        protected TextView tvTongZhiTime;

        ViewHolder(View rootView) {
            initView(rootView);
        }

        private void initView(View rootView) {
            imageTongZhiPic = (ImageView) rootView.findViewById(R.id.image_TongZhi_pic);
            tvTongZhiTitle = (TextView) rootView.findViewById(R.id.tv_TongZhi_Title);
            tvTongZhiContent = (TextView) rootView.findViewById(R.id.tv_TongZhi_Content);
            tvTongZhiTime = (TextView) rootView.findViewById(R.id.tv_TongZhi_Time);
        }
    }
}
